<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>后台首页</title>
    <link rel="stylesheet" href="/Demo/css/bootstrap.min.css" />
    <style>
     
      h1 {
        margin-left: 300px;
      }
      .b1 {
        padding: 10px;
        position: absolute;
        top: 50px;
        right: 300px;
      }
      .b {
        padding: 10px;
        position: absolute;
        top: 50px;
        right: 350px;
      }

      .b2 {
        padding: 20px;
        color: #ffff;
        background-color: rgb(117, 117, 243);
      }

      .i1 {
        margin: 10px;
        height: 40px;
        width: 300px;
      }
      table {
        margin-top: 30px;
      }
      .c2 {
        text-align: center;
        margin: 50px auto;
        width: 800px;
      }

      .c3 {
        margin-left: 500px;
      }
      h4{
        margin-left: 500px;
      }

      tr input {
        text-align: center;
        width: 60px;
      }
      table tr td:first-child {
        width: 60px;
      }
      .b2{
        margin-right: 350px;
        padding: 10px;
        float: right;
      }
    </style>
  </head>

  <body>
    <div class="c1">
      <h1 id="time"></h1>
      <button class="b1" onclick="window.close()">关闭</button>
      <button class="b" onclick="location.reload();getTime()">刷新</button>
    </div>
    <div class="c2">
      <div class="form-inline">
        <label for="id">编号：</label>
        <input id="id" type="text" class="form-control" />

        <label for="name">名字：</label>
        <input id="name" type="text" class="form-control" />

        <label for="name">价格：</label>
        <input id="price" type="text" class="form-control" />
        <input
          type="button"
          value="添加"
          class="btn btn-info btn-sm"
          onclick="createtr()"
        />
      </div>
      <table id="table" class="table table-bordered table-hover table-striped">
        <thead>
        <tr>
          <td><input type="checkbox" id="master" /></td>
          <td>编号</td>
          <td>名字</td>
          <td>数量</td>
          <td>价格</td>
          <td>操作</td>
        </tr>
      </thead>
      <tbody id="tbody">
        <tr>
          <td><input type="checkbox" /></td>
          <td>1001</td>
          <td>三国演义</td>
          <td><input type="number" value="1" min="1" money="100"/></td>
          <td><span>￥</span>100</td>
          <td>
            <input type="button" value="收藏" class="btn btn-xs bg-info" />
            <input type="button" value="删除" class="btn btn-warning btn-xs"  onclick="dal()"/>
          </td>
        </tr>
        <tr>
          <td><input type="checkbox" /></td>
          <td>1002</td>
          <td>水浒传</td>
          <td><input type="number" value="1" min="1" money="200"/></td>
          <td><span>￥</span>200</td>
          <td>
            <input type="button" value="收藏" class="btn btn-xs bg-info" />
            <input type="button" value="删除" class="btn btn-warning btn-xs" onclick="dal()"/>
          </td>
        </tr>
      </tbody>
      </table>
    </div>
    <p class="c3">
      总金额：￥<span id="prices"></span>
      <button class="b2" onclick="show()">结算</button>
    </p>
    <p id="last"></p>
    <script>
      //如果不是登录页面过来的就不允许访问
      //获取前一个地址，要http地址
      // let preurl = document.referrer;
      // if (preurl == "" || preurl == null || preurl == undefined) {
      //   document.body.innerHTML = "<h1>你不是从登录过来的，请先登录！</h1>";
      // }
    </script>
    <script src="/JS/js/当当.js"></script>
  </body>
</html>
